package com.pxst.fo.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pxst.bank.resp.BankInfoResp;
import com.pxst.fo.sys.entity.FoOrderMainEntity;
import com.pxst.fo.sys.req.FoOrderMainReq;
import com.pxst.fo.sys.resp.FoOrderMainResp;
import com.pxst.resp.ApiResp;
import icu.mhb.mybatisplus.plugln.base.mapper.JoinBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface SysFoOrderMainMapper extends JoinBaseMapper<FoOrderMainEntity> {

    List<FoOrderMainResp> selectPage(@Param("foReq")FoOrderMainReq foReq);

    /**
     * 银行-信息-用户发起金额总额
     * @return
     */
    @Select("select sum(request_amount) as amount from sys_fo_order_main where status in (1,2)")
    Integer SumFoAmount();

    /**
     * 银行-信息-总行数
     * @return
     */
    @Select("select count(*) as count from sys_fo_order_main where status in (1,2)")
    Integer count();

}
